🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / map / src / commonMain / kotlin / org / meshtastic / feature / map / tiles / Attribution.kt
Displaying Raw • Download
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/tiles/Attribution.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 2.21 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.map.tiles
Tff7b72private Tff7b72val Te6edf3HTML_TAG Tff7b72= Te6edf3RegexTb4b4b4(Ta5d6ff"Ta5d6ff<[^>]*>Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3REPEATED_WHITESPACE Tff7b72= Te6edf3RegexTb4b4b4(Ta5d6ff"Ta5d6ff\\Ta5d6ffs+Ta5d6ff"Tb4b4b4)
T8b949e/** Only the entities our own attribution strings actually use; this is not a general HTML decoder. */
Tff7b72private Tff7b72val Te6edf3HTML_ENTITIES Tff7b72=
Te6edf3listOfTb4b4b4(Ta5d6ff"Ta5d6ff©Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff©Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff<Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff<Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff>Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff>Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff"Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff\"Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff&Ta5d6ff" Te6edf3to Ta5d6ff"Ta5d6ff&Ta5d6ff"Tb4b4b4)
T8b949e/**
* The attribution string as plain text.
*
* [RasterTileSpec.attributionHtml] is HTML because that is the form MapLibre's attribution ornament renders. A renderer
* with no such ornament still has to show the credit — OpenStreetMap's and Esri's tile policies both require it — so
* rather than drop it or print `© <a href=…>`, the markup comes off here.
*
* `&` is decoded last so an escaped entity does not turn into a live one.
*/
Tff7b72fun Te6edf3StringTb4b4b4.Td2a8ffattributionPlainTextTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657String Tb4b4b4{
Tff7b72val Te6edf3withoutTags Tff7b72= Te6edf3HTML_TAGTb4b4b4.Te6edf3replaceTb4b4b4(Tff7b72thisTb4b4b4, Ta5d6ff"Ta5d6ff"Tb4b4b4)
Tff7b72val Te6edf3decoded Tff7b72= Te6edf3HTML_ENTITIESTb4b4b4.Te6edf3foldTb4b4b4(Te6edf3withoutTagsTb4b4b4) Tb4b4b4{ Te6edf3textTb4b4b4, Tb4b4b4(Te6edf3entityTb4b4b4, Te6edf3charTb4b4b4) Tff7b72-Tff7b72> Te6edf3textTb4b4b4.Te6edf3replaceTb4b4b4(Te6edf3entityTb4b4b4, Te6edf3charTb4b4b4) Tb4b4b4}
Tff7b72return Te6edf3REPEATED_WHITESPACETb4b4b4.Te6edf3replaceTb4b4b4(Te6edf3decodedTb4b4b4, Ta5d6ff"Ta5d6ff Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3trimTb4b4b4(Tb4b4b4)
Tb4b4b4}
T8b949e/** The credits owed for a basemap and whatever overlays are drawn over it, joined for a single line of text. */
Tff7b72fun Td2a8ffmapAttributionTextTb4b4b4(Te6edf3basemapTb4b4b4: Te6edf3RasterTileSpec?Tb4b4b4, Te6edf3overlaysTb4b4b4: Te6edf3ListTff7b72<Te6edf3RasterTileSpecTff7b72>Tb4b4b4)Tb4b4b4: Tffa657String Tff7b72=
Tb4b4b4(Te6edf3listOfNotNullTb4b4b4(Te6edf3basemapTff7b72?.Te6edf3attributionHtmlTb4b4b4) Tff7b72+ Te6edf3overlaysTb4b4b4.Te6edf3mapNotNull Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3attributionHtml Tb4b4b4}Tb4b4b4)
Tb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3attributionPlainTextTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4.Te6edf3filter Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3isNotBlankTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4.Te6edf3distinctTb4b4b4(Tb4b4b4)
Tb4b4b4.Te6edf3joinToStringTb4b4b4(Ta5d6ff"Ta5d6ff · Ta5d6ff"Tb4b4b4)
Served by rngit 1.5.4 - Generated in 0.08s